package com.wangp.qms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wangp.qms.common.Constant;
import com.wangp.qms.entity.User;
import com.wangp.qms.service.INumGeneratorService;


@Controller
public class CustomerController {
	
	@Autowired
	private INumGeneratorService iNumGeneratorService;
	
	
	@ResponseBody
	@RequestMapping("/viptoqueue")
	public String vipToQueue(){
		iNumGeneratorService.generatorVipNum(new User(Constant.CustomerType.VIP_CUSTOMER));
		return "1" ;//1 成功，0 失败
	}
	
	@ResponseBody
	@RequestMapping("/priortoqueue")
	public String priorToQueue(){
		iNumGeneratorService.generatorPriorNum(new User(Constant.CustomerType.PRIOR_CUSTOMER));
		return "1" ;//1 成功，0 失败
	}
	
	@ResponseBody
	@RequestMapping("/generaltoqueue")
	public String generalToQueue(){
		iNumGeneratorService.generatorGeneralNum(new User(Constant.CustomerType.GENERAL_CUSTOMER));
		return "1" ;//1 成功，0 失败
	}
	
}